// 通用API响应类型定义
export interface ApiResponse<T = any> {
  code: number
  msg: string
  data: T
  timestamp?: number
  count?: number
}

// 列表响应类型
export interface ApiListResponse<T>
  extends ApiResponse<{
    list: T[]
    total: number
    page: number
    limit: number
  }> {}

// 详情响应类型
export interface ApiDetailResponse<T> extends ApiResponse<T> {}

// 通用分页参数
export interface PaginationParams {
  page: number
  limit: number
  keywords?: string
}

// 表格列定义
export interface TableColumn {
  prop?: string
  label: string
  width?: string | number
  minWidth?: string | number
  align?: 'left' | 'center' | 'right'
  sortable?: boolean
  fixed?: boolean | 'left' | 'right'
  formatter?: (row: any, column: any, cellValue: any, index: number) => string
  slot?: string
  type?: string
  'show-overflow-tooltip'?: boolean
}

// 表单项定义
export interface FormItem {
  prop: string
  label: string
  type: 'input' | 'select' | 'date' | 'datetime' | 'textarea' | 'number' | 'switch'
  required?: boolean
  placeholder?: string
  options?: Array<{ label: string; value: any }>
  rules?: any[]
}

// 对话框属性
export interface DialogProps {
  visible: boolean
  title: string
  width?: string
  loading?: boolean
  showFooter?: boolean
}

// 操作按钮定义
export interface ActionButton {
  text: string
  type?: 'primary' | 'success' | 'warning' | 'danger' | 'info'
  icon?: string
  disabled?: boolean
  loading?: boolean
  onClick: () => void
}

// 状态枚举
export enum CommonStatus {
  DISABLED = 0,
  ENABLED = 1,
}

// 审核状态枚举
export enum AuditStatus {
  PENDING = 0,
  APPROVED = 1,
  REJECTED = 2,
}
